/*
 * @Description: 档案接收 - 整编 主页面
 * @Author: Rfan
 * @Date: 2022-01-25 17:07:41
 * @LastEditTime: 2023-01-05 20:53:07
 */

import classNames from 'classnames/bind';
import { ReceiveTypeContext } from './contexts/ReceiveWaysContext';
import { BatchManageContextProvider } from './contexts/BatchManageContext';
import PageSidebar from './components/PageSidebar';
import PageWrap from './components/PageWrap';
import PageLayout from '@/layout/PageLayout';
import styles from './styles/batchManageMain.module.scss';
import { EnumReceiveWays } from './dictionaries';

const cx = classNames.bind(styles);

interface IBatchMgtProps {
  type: EnumReceiveWays;
  title: string;
}

const BatchManageMain = (props: IBatchMgtProps) => {
  const { type = EnumReceiveWays.ElectronicRecord, title } = props;

  return (
    <ReceiveTypeContext.Provider value={{ type, title }}>
      <BatchManageContextProvider>
        <PageLayout
          className={cx('batch-manage-main')}
          sidebar={type === EnumReceiveWays.Online ? null : <PageSidebar />}
        >
          <PageWrap />
        </PageLayout>
      </BatchManageContextProvider>
    </ReceiveTypeContext.Provider>
  );
};

export default BatchManageMain;
